-
Notifications
You must be signed in to change notification settings - Fork 56
Added documentation for conditional mocks #256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks a lot for following up on this! i like the examples and think you hit a good level of examples without being overly verbose.
i have a few changes i'd like, though.
clients/mock-client.rst
Outdated
class YourTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @expectedException \Exception |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd prefer dock to follow best practices and do $this->expectException(\Exception::class);
in the code, on the line before sending the request.
clients/mock-client.rst
Outdated
|
||
// $requestMatcher is an instance of Http\Message\RequestMatcher | ||
|
||
$response = $this->createMock('Psr\Http\Message\ResponseInterface'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use use
statements and the ::class
pseudo constant (for the code, the comment about $requestMatcher is fine.
clients/mock-client.rst
Outdated
|
||
// $requestMatcher is an instance of Http\Message\RequestMatcher | ||
|
||
$response = $this->createMock('Psr\Http\Message\ResponseInterface'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this not be an exception for the test to behave as expected?
I'd agree with all the comments. On some of the style preferences, there's a couple of places in the docs which might want to be updated to match, for consistency if that's the preferred style. I've updated the pull-request anyway - hope that's better. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks a lot!
Relates to #255 and php-http/mock-client#27